package repo

func NewDomainGen() *DomainGen {
	return &DomainGen{}
}

type DomainGen struct {
	tplRepo

	tplDir string
}

func (r *DomainGen) WithTplDir(tplDir string) *DomainGen {
	r.tplDir = tplDir
	return r
}

func (r *DomainGen) ExecuteCmdDomain(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_register.go.tpl", arg)
}

func (r *DomainGen) ExecuteBackDomain(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain.go.tpl", arg)
}

// Domain ApiProvider
func (r *DomainGen) ExecuteBackDomainApiProvider(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_api_provider.go.tpl", arg)
}

// Domain Conf
func (r *DomainGen) ExecuteBackDomainConf(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_conf.go.tpl", arg)
}

// Domain Entity
func (r *DomainGen) ExecuteBackDomainEntity(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_entity_migrate.go.tpl", arg)
}

// Domain Http
func (r *DomainGen) ExecuteBackDomainHttp(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_http.go.tpl", arg)
}

// Domain HttpApi
func (r *DomainGen) ExecuteBackDomainHttpApi(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_http_api.tpl", arg)
}

// Domain HttpRouter
func (r *DomainGen) ExecuteBackDomainHttpRouter(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_http_router.go.tpl", arg)
}

// Domain HttpWire
func (r *DomainGen) ExecuteBackDomainHttpWire(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_http_wire.go.tpl", arg)
}

// Domain RepoProvider
func (r *DomainGen) ExecuteBackDomainRepoProvider(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_repo_provider.go.tpl", arg)
}

// Domain ServiceProvider
func (r *DomainGen) ExecuteBackDomainServiceProvider(arg any) (string, error) {
	return r.executeTpl(r.tplDir, "backend/go/domain_service_provider.go.tpl", arg)
}
